<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="java.text.SimpleDateFormat,java.util.Date" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<%--@elvariable id="actionBean" type="able.stripes.AbleActionBean"--%>
<%@ include file="/WEB-INF/jsp/include/taglibs.jspf" %>
<decorator:usePage id="pageContent" />
<fmt:setBundle basename="StripesResources"/>
<%    
    boolean front = (request.getRequestURI().indexOf("/home.jsp") > 0); //Hack! main page!!            
    boolean search_page = (request.getRequestURI().indexOf("/search.jsp") > 0 || request.getRequestURI().indexOf("/search_result.jsp") > 0);
    pageContext.setAttribute("front", front, pageContext.PAGE_SCOPE);
    pageContext.setAttribute("search_page", search_page, pageContext.PAGE_SCOPE);
    pageContext.setAttribute("datetime", new SimpleDateFormat("dd/MM/yyyy | hh:mm").format(new Date()));
%>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>:: BIMS ::</title>
        <link href="${pageContext.request.contextPath}/css/style1.css" rel="stylesheet" type="text/css" />
        <link type="text/css" href="${pageContext.request.contextPath}/css/ui-lightness/jquery-ui-1.8.17.custom.css" rel="stylesheet" />
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/slide.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/flyOutMenu.css" type="text/css" media="screen">
            <script type='text/javascript' src='${pageContext.request.contextPath}/js/jquery-1.5.2.min.js'></script>
            <script type='text/javascript' src='${pageContext.request.contextPath}/js/jquery-ui-1.8.17.custom.min.js'></script>
            <script src="${pageContext.request.contextPath}/js/slide.js" type="text/javascript"></script>
            <script src="${pageContext.request.contextPath}/js/cufon-yui.js" type="text/javascript"></script>
            <script src="${pageContext.request.contextPath}/js/jquery.easing.1.3.js" type="text/javascript"></script>
            <script src="${pageContext.request.contextPath}/js/jquery-1.1.2.js" type="text/javascript"></script>
            <script src="${pageContext.request.contextPath}/js/jquery.bgiframe.js" type="text/javascript"></script>
            <script src="${pageContext.request.contextPath}/js/jquery.dimensions.js" type="text/javascript"></script>
            <script src="${pageContext.request.contextPath}/js/jquery.jdMenu.js" type="text/javascript"></script>
            <link rel="stylesheet" href="${pageContext.request.contextPath}/css/menu/jdMenu.css" type="text/css" />
            <link rel="stylesheet" href="${pageContext.request.contextPath}/css/menu/jdMenu.slate.css" type="text/css" />
            <link rel='stylesheet' type='text/css' href='${pageContext.request.contextPath}/css/fullcalendar/fullcalendar.css' />
            <link rel='stylesheet' type='text/css' href='${pageContext.request.contextPath}/css/fullcalendar/fullcalendar.print.css' media='print' />
            <script type='text/javascript' src='${pageContext.request.contextPath}/js/fullcalendar.min.js'></script>
            <script type="text/javascript">
                $(document).ready(function(){                
                    $('select').each(function(){
                        $(this).focus(function(){
                            $(this).addClass('focus');
                        });
                        $(this).blur(function(){
                            $(this).removeClass('focus');
                        });
                    });
                    $('input:text').each(function(){
                        if (!$(this).hasClass('normal_text')){
                            $(this).focus(function(){
                                $(this).addClass('focus');
                            });
                            $(this).blur( function() {
                                $(this).removeClass("focus");
                                $(this).val( $(this).val().toUpperCase());
                            });
                        }
                    
                    });
                    
                    $('div').find('.form_errors').each ( function() {
                            $('#open').click();
                    });
                                      
                });
                
                
            </script>
            <script type="text/javascript">
                // Initialization, you can leave this here or move this somewhere else
                $(function(){
                    $('ul.jd_menu').jdMenu({	onShow: loadMenu
                        //onHideCheck: onHideCheckMenu,
                        //onHide: onHideMenu, 
                        //onClick: onClickMenu, 
                        //onAnimate: onAnimate
                    });
                    $('ul.jd_menu_vertical').jdMenu({onShow: loadMenu, onHide: unloadMenu, offset: 1, onAnimate: onAnimate});
                });

                function onAnimate(show) {
                    //$(this).fadeIn('slow').show();
                    if (show) {
                        $(this)
                        .css('visibility', 'hidden').show()
                        .css('width', $(this).innerWidth())
                        .hide().css('visibility', 'visible')
                        .fadeIn('normal');
                    } else {
                        $(this).fadeOut('fast');
                    }
                }

                var MENU_COUNTER = 1;
                function loadMenu() {
                    if (this.id == 'dynamicMenu') {
                        $('> ul > li', this).remove();
			
                        var ul = $('<ul></ul>');
                        var t = MENU_COUNTER + 10;
                        for (; MENU_COUNTER < t; MENU_COUNTER++) {
                            $('> ul', this).append('<li>Item ' + MENU_COUNTER + '</li>');
                        }
                    }
                }

                function unloadMenu() {
                    if (MENU_COUNTER >= 30) {
                        MENU_COUNTER = 1;
                    }
                }

                // We're passed a UL
                function onHideCheckMenu() {
                    return !$(this).parent().is('.LOCKED');
                }

                // We're passed a LI
                function onClickMenu() {
                    $(this).toggleClass('LOCKED');
                    return true;
                }
            </script>
            <script type='text/javascript'>

                $(document).ready(function() {	
                
                    var $tabs  = $("div#tabs").tabs();  
                
                    $('#calendar').fullCalendar({
		
                        // US Holidays
                        events: 'http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic',
			
                        eventClick: function(event) {
                            // opens events in a popup window
                            window.open(event.url, 'gcalevent', 'width=700,height=600');
                            return false;
                        },
			
                        loading: function(bool) {
                            if (bool) {
                                $('#loading').show();
                            }else{
                                $('#loading').hide();
                            }
                        }
			
                    });
                
                
                    var speed = 700;
                    var pause = 3500;
                    function removeFirst(){
                        $('ul#listticker li:first').fadeOut('slow', function() {addLast(this);});
                    }
                    function addLast(first){
                        $(first).insertAfter('ul#listticker li:last').fadeIn('slow');
                    }

                    interval = setInterval(removeFirst, pause);
                
		
                });

            </script>
            <style type='text/css'>


                #loading {
                    position: absolute;
                    top: 5px;
                    right: 5px;
                }

                #calendar {
                    width: 250px;
                    margin: 0 auto;                
                    text-align: center;
                    font-size: 10px;
                    font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
                }


                #listticker{
                    height:200px;
                    width:300px;
                    overflow:hidden;
                    border:solid 1px #DEDEDE;
                    padding:6px 10px 14px 10px;
                }
                #listticker li{
                    border:0; margin:0; padding:0; list-style:none;
                }

                #listticker li{
                    height:60px;
                    padding:5px;
                    list-style:none;
                }
                #listticker a{
                    color:#000000;
                }
                #listticker .news-title{
                    display:block;
                    font-weight:bold;
                    margin-bottom:4px;
                    font-size:11px;
                }
                #listticker .news-text{
                    display:block;
                    font-size:11px;
                    color:#666666;
                }
                #listticker img{
                    float:left;
                    margin-right:14px;
                    padding:4px;
                    border:solid 1px #DEDEDE;
                }


            </style>
    </head>
    <decorator:head/>
    <body>

        <div id="toppanel">
            <div id="panel">
                <div class="content clearfix">
                    <div class="left">
                        <!-- Login Form -->
                        <form:form beanclass="ipfms.stripes.LoginActionBean">
                            <h1>Member Login</h1>
                            <label class="grey" for="log">Username :</label>
                            <s:text name="userLogin" size="23" class="normal_text"/>
                            <label class="grey" for="pwd">Password :</label>
                            <s:password name="userPassword" size="23" class="normal_text"/>
                            <label class="grey"><input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> &nbsp;Remember me</label>
                            <div class="clear"></div>
                            <s:submit name="login" value="Log In" class="bt_login"/>
                            <a class="lost-pwd" href="#">Lost your password?</a>
                        </form:form>

                    </div>
                </div>
            </div> <!-- /login -->	

            <!-- The tab on top -->	
            <div class="tab">
                <ul class="login">
                    <li class="left">&nbsp;</li>
                    <li>Hello 
                        <c:if test="${empty actionBean.context.currentUser}">Guest!</c:if>
                        <c:if test="${!empty actionBean.context.currentUser}">${actionBean.context.currentUser.idPengguna}!!</c:if>                        
                    </li>
                    <li class="sep">|</li>
                    <c:if test="${empty actionBean.context.currentUser}">
                        <li id="toggle">
                            <a id="open" class="open" href="#">Log In</a>
                            <a id="close" style="display: none;" class="close" href="#">Close</a>			
                        </li>
                    </c:if>
                    <c:if test="${!empty actionBean.context.currentUser}">
                        <li>
                            <a href="logout" class="close">Logout</a>                       
                        </li>
                    </c:if>
                    <li class="right">&nbsp;</li>
                </ul> 
            </div> <!-- / top -->

        </div> <!--panel -->
        <table width="1000" border="0" cellspacing="0" cellpadding="0" align="center">
            <tr>
                <td class="shadow_left">&nbsp;</td>
                <td class="header_column">
                    <table width="1000" border="0" cellspacing="10" cellpadding="0">

                    </table></td>
                <td class="shadow_right">&nbsp;</td>
            </tr>
            <c:if test="${front || search_page}"> 
                <tr>
                    <td class="horizontal_column">&nbsp; </td>

                    <td class="horizontal_center"><table width="1000" border="0" cellpadding="0" cellspacing="0" class="linkcontainer">
                            <tr>
                                <td><div class="navigation"><a href="welcome" class="main_link">Home</a></div></td>
                                <c:if test="${!empty actionBean.context.currentUser}">
                                    <c:if test="${actionBean.context.currentUser.kodJenisPengguna.code eq '01'}">
                                        <td><div class="navigation"><a href="property" class="main_link">Post Property</a></div></td></c:if>
                                    <c:if test="${actionBean.context.currentUser.kodJenisPengguna.code eq '02'
                                                  || actionBean.context.currentUser.kodJenisPengguna.code eq '03'
                                                  || actionBean.context.currentUser.kodJenisPengguna.code eq '05'}">
                                          <td><div class="navigation"><a href="inbox" class="main_link">Inbox</a></div></td>
                                    </c:if>  
                                    <c:if test="${actionBean.context.currentUser.kodJenisPengguna.code eq '06'  or actionBean.context.currentUser.kodJenisPengguna.code eq '07'}">
                                        <td><div class="navigation"><a href="report_list" class="main_link">List Of Complaints</a></div></td>
                                        <td><div class="navigation"><a href="check_complaint" class="main_link">Check Complaints</a></div></td>
                                    </c:if>
                                    <c:if test="${actionBean.context.currentUser.kodJenisPengguna.code eq '99'}">
                                        <td><div class="navigation"><a href="uam_register" class="main_link">Registration User</a></div></td>
                                        <td><div class="navigation"><a href="chg_pwd" class="main_link">Change Password</a></div></td>
                                    </c:if>
                                </c:if>
                                <td><div class="navigation"><a href="#" class="main_link">About Us</a></div></td>
                                <td><div class="navigation"><a href="#" class="main_link">Trader</a></div></td>
                                <td><div class="navigation"><a href="#" class="main_link">Buy</a></div></td>
                                <td><div class="navigation"><a href="#" class="main_link">Sell</a></div></td>
                                <td><div class="navigation"><a href="#" class="main_link">Help</a></div></td>
                            </tr>
                        </table>
                        <table width="300"  height="100" border="0" cellpadding="0" cellspacing="0" class="linkcontainer">
                            <tr>
                                <td><div class="navigation2"><a href="welcome?search" class="main_link2">Property</a></div></td>
                            </tr>
                        </table>
                        <table width="300" height="100" border="0" cellpadding="0" cellspacing="0" class="linkcontainer">
                            <tr>
                                <td><div class="navigation2"><a href="#" class="main_link2">Facilities</a></div></td>
                            </tr>
                        </table>
                    </td>
                    <td class="horizontal_column">&nbsp;</td>
                </tr>
                <tr>
                    <td class="shadow_left">&nbsp;</td>
                    <td class="below_header"><marquee behavior="scroll" direction="left" scrollamount="5">BIMS : Building Intelligence Management Systems&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :: EASY : QUICK : COMPLETE ::&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Managing Your Property</marquee>
                    </td>
                    <td class="shadow_right">&nbsp;</td>
                </tr>
            </c:if>
            <c:if test="${!front && !search_page}">  <tr>
                    <td class="horizontal_column2">&nbsp; </td>
                    <td class="horizontal_center2"><table width="1000" border="0" cellpadding="0" cellspacing="0" class="linkcontainer">
                            <tr>
                                <td><div class="navigation"><a href="welcome" class="main_link">Home</a></div></td>
                                <c:if test="${!empty actionBean.context.currentUser}">
                                    <c:if test="${actionBean.context.currentUser.kodJenisPengguna.code eq '01'}">
                                        <td><div class="navigation"><a href="property" class="main_link">Post Property</a></div></td></c:if>
                                    <c:if test="${actionBean.context.currentUser.kodJenisPengguna.code eq '02'
                                                  || actionBean.context.currentUser.kodJenisPengguna.code eq '03'
                                                  || actionBean.context.currentUser.kodJenisPengguna.code eq '05'}">
                                          <td><div class="navigation"><a href="inbox" class="main_link">Inbox</a></div></td>
                                    </c:if>  
                                    <c:if test="${actionBean.context.currentUser.kodJenisPengguna.code eq '06'  or actionBean.context.currentUser.kodJenisPengguna.code eq '07'}">
                                        <td><div class="navigation"><a href="report_list" class="main_link">List Of Complaints</a></div></td>
                                        <td><div class="navigation"><a href="check_complaint" class="main_link">Check Complaints</a></div></td>
                                    </c:if>
                                    <c:if test="${actionBean.context.currentUser.kodJenisPengguna.code eq '99'}">
                                        <td><div class="navigation"><a href="uam_register" class="main_link">Registration User</a></div></td>
                                        <td><div class="navigation"><a href="chg_pwd" class="main_link">Change Password</a></div></td>
                                    </c:if>
                                </c:if>
                            </tr>
                        </table>
                    </td>  </tr></c:if>

                <tr>
                    <td class="shadow_left">&nbsp;</td>
                    <td class="main_content_box"><table width="1000" border="0" cellspacing="0" cellpadding="0"> 
                        <c:if test="${front}"> 
                            <tr>
                                <td class="left_content">   <img src="${pageContext.request.contextPath}/images/facebooklogo.jpg" width="100"/>
                                <img src="${pageContext.request.contextPath}/images/twitter.png" width="100"/>
                                <img src="${pageContext.request.contextPath}/images/google.jpg" width="100"/></td>
                                <td class="body_content2" width="200">
                                    <h4  class="header1"><strong>ANNOUNCEMENT</strong> </h4>
                                    <ul id="listticker">
                                        <li>
                                            <img src="images/who.jpg" width="50" height="50"/>
                                            <a href="" onclick="alert('not yet available');" class="news-title">Agent Available!</a>
                                            <span class="news-text">New Agent available in Lembah Klang!!</span>
                                        </li>
                                        <li>
                                            <img src="images/1_1_empty.gif" />
                                            <a href="" onclick="alert('not yet available');" class="news-title">Sale Or Rent!</a>
                                            <span class="news-text">New Apartment Available!!</span>
                                        </li>
                                        <li>
                                            <img src="images/who.jpg" width="50" height="50"/>
                                            <a href="" onclick="alert('not yet available');" class="news-title">Web Designer needed!</a>
                                            <span class="news-text">Interesting Salary, a lot of Benefits , permanent !!</span>
                                        </li>
                                        <li><img src="images/who.jpg" width="50" height="50"/>
                                            <a href="" onclick="alert('not yet available');" class="news-title">Agent needed!</a>
                                            <span class="news-text">Interesting Salary, a lot of Benefits , permanent !!</span></li>
                                        <li>My News 5</li>
                                    </ul></td>
                                <td class="body_content2" width="250" valign="top">
                                    <h4  class="header1"><strong>SERVICES</strong> </h4>
                                    <a href="http://www.yellowpages.com.my/category" target="_blank">
                                        <img src="${pageContext.request.contextPath}/images/yellow_pages.jpg" width="100"/>
                                    </a></td>
                            </tr></c:if>  
                            <c:if test="${!front || search_page}"> <td class="body_content"> <decorator:body/></td></c:if>
                    </table></td>
                <td class="shadow_right">&nbsp;</td>
            </tr>
            <tr>
                <td class="shadow_left">&nbsp;</td>
                <td class="middle_spacer">&nbsp;</td>
                <td class="shadow_right">&nbsp;</td>
            </tr>
            <tr>
                <td class="shadow_left">&nbsp;</td>
                <td class="bottom_link_container"> &copy; Copyright 2012 BIMS. All Rights Reserved. Disclaimer | Terms and Condition</td>
                <td class="shadow_right">&nbsp;</td>
            </tr>
        </table>
    </body>
</html>